<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
	body>div{
			width:253px;                
			border: 4px solid pink;
			border-radius:4px;   
			margin: 0 auto;    
			overflow: hidden;  
			padding-bottom: 4px; 
	}
	input{
			width: 45px;
			height: 45px;
			border-radius:4px;  
			margin: 0 auto;    
			float:left;       
			margin: 4px 0 0 4px; 
			background-color: pink;
	}
	div>div{
			width: 184px;
			height: 37px;
			border: 4px solid pink;
			border-radius:4px;
			margin: 4px 0 0 4px; 
			float:left;         
			overflow: hidden;
			line-height: 37px;
		}
		h4{
			text-align: center;
			margin: 0 auto;
			color: green;	
		}
		a{
			text-decoration:none;  /* 去除超链接的下划线 */
		}
		/*悬停  */	
		a:hover{
			color:yellow;
		}
	*{
		font-family:"微软雅黑";
	}
</style>
<script type="text/javascript">
		function myfn(str){
			if(str=="C"){
				d1.innerText = "";
			}else if(str =="="){
				d1.innerText = eval(d1.innerText)
			}else{
				d1.innerText +=str;
			}
			
		}
</script>
</head>
<body>
<div>
	<h1 align="center">简易计算器</h1>
	<hr>
	<a href="http://www.baidu.cn">&nbsp;查看(V)</a>
	<a href="http://www.jd.cn">&nbsp;编辑(E)</a>
	<a href="http://www.taobao.cn">&nbsp;帮助(H)</a>
	<hr>
	<div id="d1"></div>
		<input type="button"value="C" onclick="myfn('C')">
		<input type="button"value="7" onclick="myfn('7')">
		<input type="button"value="8" onclick="myfn('8')">
		<input type="button"value="9" onclick="myfn('9')">
		<input type="button"value="M+" onclick="myfn('M+')">
		<input type="button"value="M-"onclick="myfn('M-')">
		<input type="button"value="4" onclick="myfn('4')">
		<input type="button"value="5" onclick="myfn('5')">
		<input type="button"value="6" onclick="myfn('6')">
		<input type="button"value="/" onclick="myfn('/')">
		<input type="button"value="√" onclick="myfn('√')">
		<input type="button"value="1" onclick="myfn('1')">
		<input type="button"value="2" onclick="myfn('2')">
		<input type="button"value="3" onclick="myfn('3')">
		<input type="button"value="*" onclick="myfn('*')">
		<input type="button"value="%" onclick="myfn('%')">
		<input type="button"value="0" onclick="myfn('0')">
		<input type="button"value="." onclick="myfn('.')">
		<input type="button"value="+" onclick="myfn('+')">
		<input type="button"value="-" onclick="myfn('-')">
		<input type="button"value="=" onclick="myfn('=')">
		<h4>王璐专属计算器</h4>
</div>
</body>
</html>